<template>
  <div>
    <baseContainer title="基本用法  有禁用选项">
    <x-select v-model="model">
      <x-option v-for="i in 10" :key="i+'_'" :label="i+'labels'" :value="i" :disabled="i%4==0">
      <span>
      {{ i+'labels' }}
      </span>
      <span style="float: right;">{{ i }}</span>
      </x-option>
    </x-select>
  </baseContainer>
  <baseContainer title="查询下拉">
    <x-select v-model="model" :search="true">
      <x-option v-for="i in 10" :key="i+'_'" :label="i+'labels'" :value="i" :disabled="i%4==0">
      <span>
      {{ i+'labels' }}
      </span>
      <span style="float: right;">{{ i }}</span>
      </x-option>
    </x-select>
  </baseContainer>
  <baseContainer title="分组选项">
    <x-select v-model="models">
      <x-option-group v-for="item in options" :key="item.label" :label="item.label">
        <x-option v-for="i in item.options" :key="i.value" :label="i.label" :value="i.value"></x-option>
      </x-option-group>
    </x-select>
  </baseContainer>
  <baseContainer title="日期选择器">
      <x-date-picker v-model="now"></x-date-picker>
    </baseContainer>
  </div>
</template>

<script lang="ts">
import { defineComponent,ref } from 'vue'
import baseContainer from './baseContainer.vue'
export default defineComponent({
  components: {
    baseContainer
  },
  setup () {
    const model = ref(6)
    const models = ref('')
    const now = ref(null)
    const options = [
  {
    label: 'Popular cities',
    options: [
      {
        value: 'Shanghai',
        label: 'Shanghai',
      },
      {
        value: 'Beijing',
        label: 'Beijing',
      },
    ],
  },
  {
    label: 'City name',
    options: [
      {
        value: 'Chengdu',
        label: 'Chengdu',
      },
      {
        value: 'Shenzhen',
        label: 'Shenzhen',
      },
      {
        value: 'Guangzhou',
        label: 'Guangzhou',
      },
      {
        value: 'Dalian',
        label: 'Dalian',
      },
    ],
      },
      {
    label: 'City',
    options: [
      {
        value: 'Chedu',
        label: 'Chengdu',
      },
      {
        value: 'Shehen',
        label: 'Shenzhen',
      },
      {
        value: 'Guangou',
        label: 'Guangzhou',
      },
      {
        value: 'Dalian',
        label: 'Dalian',
      },
    ],
  },
]
    return {model,options,models,now}
  }
})
</script>

<style scoped>

</style>